dofile ("libProgressBar.lua")

pb1 = ProgressBar.new(SCREEN_DOWN, 5, 5, 150, 25, 50, 1)
pb2 = ProgressBar.new(SCREEN_DOWN, 5, 40, 200, 30, 50, 2, c_red)
pb3 = ProgressBar.new(SCREEN_DOWN, 5, 80, 50, 15, 50, 3, c_blue)
pb4 = ProgressBar.new(SCREEN_DOWN, 5, 105, 250, 35, 50, 4, c_yellow)

while not Keys.held.Start do
	
	Controls.read()
	
	startDrawing()
		
		pb1:draw()
		pb2:draw()
		pb3:draw()
		pb4:draw()
		
		if Keys.held.Right then
			pb1:incValue(1)
			pb2:decValue(1)
		end
		if Keys.held.Left then
			pb1:decValue(1)
			pb2:incValue(1)
		end
		if Keys.held.Down then
			pb3:incValue(1)
			pb4:decValue(1)
		end
		if Keys.held.Up then
			pb3:decValue(1)
			pb4:incValue(1)
		end
		
		screen.print (SCREEN_UP, 5, 5, "ProgressBar 1 Value : "..pb1:getValue().." / "..pb1:getMaxValue().."")
		screen.print (SCREEN_UP, 5, 25, "ProgressBar 2 Value : "..pb2:getValue().." / "..pb2:getMaxValue().."")
		screen.print (SCREEN_UP, 5, 45, "ProgressBar 3 Value : "..pb3:getValue().." / "..pb3:getMaxValue().."")
		screen.print (SCREEN_UP, 5, 65, "ProgressBar 4 Value : "..pb4:getValue().." / "..pb4:getMaxValue().."")
		screen.print (SCREEN_UP, 5, 85, "Held any directional key to")
		screen.print (SCREEN_UP, 5, 95, "increase or decrease values")
		
	stopDrawing()
	
end

pb1:clear()
pb2:clear()
pb3:clear()
pb4:clear()

collectgarbage()
